package com.example.async.async.controller;

import com.example.async.async.service.AnsycService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xieqiong
 * 异步任务
 */
@RestController
public class AsyncController {

    @Autowired
    private AnsycService ansycService;

    @RequestMapping(value="/index",method = RequestMethod.GET)
    public void index(){
        ansycService.task1();
        ansycService.task2();
        ansycService.task3();
    }
}
